<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('出入库记录列表')" />
</head>
<body>

<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var websocket = null;
    if('WebSocket' in window){
        websocket = new WebSocket("ws://"+localhostAddress+":8081/websocket/2");
    }else{
        console.info("您的浏览器不支持websocket");
    }
    websocket.onerror = function(){
        console.info("websocket发送错误！");
    }
    websocket.onopen = function(){
        console.info("websocket连接成功！")
    }
    var flagBtn=true;
    websocket.onmessage  = function(event){
        console.info(event.data);
        getValueGet(event.data);
    }
    websocket.onclose = function(){
        console.info("关闭websocket!")
    }
    window.onbeforeunload = function(){
        clos();
    }
    function clos(){
        websocket.close(1000,"强制关闭");
    }
</script>
</body>
</html>